<script setup lang="ts">
import { computed, ref } from 'vue';
defineOptions({
  name: 'ConsultMore'
})
const props = defineProps<{
  disabled?: boolean
}>()
const emit = defineEmits<{
  'on-delete': [],
  'on-showpre': []
}>()
//更多气泡弹出框
const showPopover = ref(false)
const actions = computed(() => [{ text: '查看处方', disabled: props.disabled },
{ text: '删除订单' }])
const onSelect = (actions: { text: string }, index: number) => {
  //查看出处方
  if (index === 0) emit('on-showpre')
  //删除订单
  if (index === 1) emit('on-delete')
}
</script>
<template>
  <div class="consult-more">
    <van-popover :actions="actions" placement="top-start" @select="onSelect" v-model:show="showPopover">
      <template #reference>
        更多
      </template>
    </van-popover>
  </div>
</template>

<style scoped>
.consult-more {
  color: var(--cp-tag);
  flex: 1;
  font-size: 13px;
}
</style>